package com.exam.mapper;

import com.exam.entity.*;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface ProvideExamMapper {
    @Select("select * from exam_programming_question where score = #{score} order by rand() limit #{question_count}")
    List<ExamProgrammingQuestion> randomProgramming(int question_count,String score);
    @Select("select * from exam_multiple_choice where score = #{score} order by rand() limit #{question_count}")
    List<ExamMultipleChoice> randomMultipleChoice(int question_count,String score);
    @Select("select * from exam_essay_questions where score = #{score_count} order by rand() limit #{question_count}")
    List<ExamEssayQuestion> randomEssayQuestion(int question_count,String score);
    @Select("select * from exam_single_choice where score = #{score_count} order by rand() limit #{question_count}")
    List<ExamSingleChoice> randomSingleChoice(int question_count,String score);
    @Select("select * from exam_true_false where score = #{score_count} order by rand() limit #{question_count}")
    List<ExamTrueFalse> randomTrueFalse(int question_count,String score);
}
